package com.yilin.tms.user.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yilin.tms.core.application.PageData;
import com.yilin.tms.core.entity.user.UserType;
import com.yilin.tms.core.entity.user.account.UserAccrual;
import com.yilin.tms.core.entity.user.organize.Organize;
import com.yilin.tms.core.entity.user.account.Contact;
import com.yilin.tms.core.entity.user.account.Account;
import org.springframework.transaction.annotation.Transactional;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author 作者
 * @since 2022-10-19
 */
public interface IAccountService extends IService<Account> {



    Account employeeRegister(Organize organize, Account employee, String[] jurisdictionIds);

    void login(Account account, HttpServletRequest request);

    double faceSimilarityScore(Account account, String base64FaceImg);

    void checkGeoTerminal(Account userInfo);

    List<Account> getLogicAccountByPhone(String phone);

    Account getAccountByUsername(String username);

    Account getAccountByWechatId(String wechatId);

    Account getUserAccountByToken(String token);

    Account getAccountByPhone(String phone, UserType userType);

    Account getAccountById(String accountId);

    Account getAccountByApiKey(String apiKey);

    Account getSystemAdminUser();

    Account getSystemYilinUser();

    List<Account> getAccountByRoleId(String roleId);

    List<Account> getEmployeeByOrganizeId(String organizeId);

    List<Account> getAccountByOrganizeId(String organizeId);

    List<Account> getAccountListByIds(String[] accountIds);

    PageData<Account> getAccountChildPage(Account query, Integer start, Integer limit);

    List<Account> getAccountList(String departmentId);

    List<Account> getErrorTmsAccount();

    Account saveOrUpdateAccount(Account account, Account loginUser);

    void updateUserCredit(Account loginUser, String accountId, Double diffCredit, String reason);

    void transferManager(Account manager, Account account);

    void scrapAccount(Account manager, Account account);

    void autoSetSafeEnable();

    void updateAccount(Account loginUser, Account param, Account localAccount);

    void updateUserAccrual(Account loginUser,String accountId, UserAccrual userAccrual1);

    @Transactional
    void updateAccountAndOrganize(Account loginUser, Account account, Organize organize);

    void verifySvePassword(Account loginUser, String savePassword);

    void verifySvePublicKey(Account loginUser, String fingerprintKey);

    List<Contact> getContactsList(String userId, Contact query);

    Contact getContactById(String contactId);

    void saveContacts(Contact contact);

    void deleteContacts(Contact contact);

    List<String> getPushIdList();

    List<String> getPushIdListByUserType(UserType type);

    String[] getPushIdsByUserType(Account loginUser, UserType userType);


    void test002(String organize01, String organize02, String organizeName);
}
